#ifndef _BUFFER_ALLOC_HPP_20120407
#define _BUFFER_ALLOC_HPP_20120407

#include "fixed_size_allocator.hpp"
#include "buffer.hpp"
#include "base.hpp"

namespace buffer
{
	class BufferAlloc
	{
		public :
			BufferAlloc(FixedSizeAllocator & alloc);

			int block_size() const { return _alloc.block_size(); }
			int buffer_size() const { return (block_size() - sizeof(Buffer)); }

			Buffer * allocate();

			void deallocate(Buffer * buffer);
		public :
			FixedSizeAllocator & _alloc;
			
	};
};

#endif

